{% extends "portal_template.html" %} 
{% load experimentstats %}

		{% block content %}

		<div id="content">
			<div class="post">
				<h1 class="title">
					<a href="#">Experiments</a>
				</h1>
				 {% if public_datasets %}
		            <strong>{{ experiments.count }}</strong> experiments

			    {% endif %}
				<br/><br/>			
				
				{% if experiments %}
						<table class="experiment-table">
						{% for experiment in experiments %}
							<tr>
								<th>
									<a href="../view/{{ experiment.id }}">{{ experiment.title }}
										{% if experiment.pdbid_set.count %}
											<em>({% for pdbid in experiment.pdbid_set.all %}{{ pdbid.pdbid }}{% if not forloop.last %}, {% endif %}{% endfor %})</em>							
										{% endif %}										
										
										</a>
								</th>
								
							</tr>	
							
							<tr>
								
									<td>From <strong>{{experiment.institution_name}}</strong>, deposited <strong>{{ experiment.update_time|date:"jS F Y" }}</strong></td>
							
							</tr>
							
							<tr>
								
									<td class="experiment-table-stats"><strong>{{ experiment.dataset_set.all.count }}</strong> dataset(s)
								
							</tr>				
						
						{%endfor %}
					</table>					
						
				{% else %}
					No experiments publically available at this time.
				{% endif %}
			</div>
		</div>

		{% endblock %}
		{% block sidebar %}

		<ul>
			<li>
				<h2>
					Browse Experiments
				</h2>
				<ul>
					<li>
						<a href="/experiment/view">Index</a>
					</li>
					<li>
						<a href="/search/experiment">Search</a>
					</li>					
				</ul>
				{% if user.is_authenticated %}
				<h2>
					Controls
				</h2>
				<ul>
					<li>
						<a href="/experiment/register">New Experiment</a>
					</li>
					<li>
						<a href="/experiment/control_panel">Control Panel</a>
					</li>					
				</ul>
				{% endif %}
			</li>			
		</ul>
		<p>
			
			{% endblock %}